<?php
/////////////////////////////////////////////////////////////////////////////
// 这个文件是 网城创想多用户商城 项目的一部分
//
// Copyright (c) 2007 - 2008 www.shopnc.net 
//
// 要查看完整的版权信息和许可信息，请查看源代码中附带的 COPYRIGHT 文件，
// 或者访问 http://www.shopnc.net/ 获得详细信息。
/////////////////////////////////////////////////////////////////////////////

/**
 * FILE_NAME : user_rate.php   FILE_PATH : D:\webroot\mulitishop\store\user_rate.php
 * ....信誉分显示
 *
 * @copyright Copyright (c) 2007 - 2007 www.shopnc.net 
 * @author 网城创想多用户商城开发团队 php_netproject@yahoo.com.cn
 * @package 
 * @subpackage 
 * @version Fri Oct 19 13:36:46 CST 2007
 */

require_once("../global.inc.php");

class StoreRate extends CommonFrameWork{
	/**
	 * 评价对象
	 *
	 * @var obj
	 */
	var $obj_score;
	/**
	 * 会员对象
	 *
	 * @var obj
	 */
	var $objmember;
	
	function main(){
		/**
		 * 创建评价对象
		 */
		if (!is_object($this->obj_score)){
			require_once("score.class.php");
			$this->obj_score = new ScoreClass();
		}
		/**
		 * 创建会员对象
		 */
		if (!is_object($this->objmember)){
			require_once ("member.class.php");
			$this->objmember = new Member();
		}
		
		/**
		 * 设置模板路径
		 */
		$this->setsubtemplates("store");
		
		/**
		 * 语言包
		 */
		$this->getlang("shop");
		/**
		 * 得到会员资料
		 */
		$member_array = $this->objmember->getMemberInfo($this->_input['userid']);
		
		$buy_percent = $this->obj_score->getScorePercent($this->_input['userid'],'b');
		$sale_percent = $this->obj_score->getScorePercent($this->_input['userid'],'s');
		$score_sta_array = $this->obj_score->getStatistic($this->_input['userid']);
		
		$score_array = $this->obj_score->getScore($page,$this->_input['userid'],$this->_input['genre'],$this->_input['type'],$this->_input['score'],$this->_input['time_area']);
		
		
		$this->output('score_array',$score_array);
		
		$this->output('score_sta_buy_week',$score_sta_array['b']['week']);
		$this->output('score_sta_buy_month',$score_sta_array['b']['month']);
		$this->output('score_sta_buy_halfyear',$score_sta_array['b']['halfyear']);
		$this->output('score_sta_buy_year',$score_sta_array['b']['year']);
		
		$this->output('score_sta_sale_week',$score_sta_array['s']['week']);
		$this->output('score_sta_sale_month',$score_sta_array['s']['month']);
		$this->output('score_sta_sale_halfyear',$score_sta_array['s']['halfyear']);
		$this->output('score_sta_sale_year',$score_sta_array['s']['year']);
		
		$this->output('score_sta_buy_total',$score_sta_array['b']['total']);
		$this->output('score_sta_sale_total',$score_sta_array['s']['total']);
		
		$user_rate_target = Common::replaceMailContent(array('userid'=>$this->_input['userid'],'+'=>'&'),Common::getTargetMenu("rate"));
		$this->output('InfoSelectorTarget2',$user_rate_target);
		
		$this->output('buy_percent',$buy_percent);
		$this->output('sale_percent',$sale_percent);
		$this->output('frame_shop_info',$member_array);
		$this->showpage("store_user_rate");
	}
}
$rate = new StoreRate();
$rate->main();
unset($rate);
?>